import random
import string
from App.ext import models  ,mail
    
    
    
def add(self):
    models.session.add(self)
    models.session.commit()

def save():
    models.session.commit()
    
def close():
    models.session.close()

def updata(db,site,self):
    models.session.query(db).filter(site).update(self)
    models.session.commit()
    


def getSingleMa():  # 随机数生成
    field = string.ascii_letters + string.digits
    singleMa = "".join(random.sample(field, 6))
    return singleMa
